<?php
class File{
    /**
     * creates a new file from a string
     * @param string $path
     * @param string $content
	 */
	public function saveFile($path,$content){
		file_put_contents($path,$content);
	}

    /**
     * rename the selected file
     *
     * @param string $source
     * @param string $newName
     */
    public function rename($source, $newName)
    {
        if (file_exists($source)) {
            rename($source, $newName);
        }
    }

    /**
     * move a file
     *
     * @param string $source
     * @param string $target
     */
    public function move($source, $target)
    {
        if (file_exists($source)) {
            rename($source, $target);
        }
    }

    /**
     * delete a file
     *
     * @param string $path
     */
    public function delete($path)
    {
        @unlink($path);
    }
}
